﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="CWB.Web.Mvc.Extensions" %>
<%@ Import Namespace="CWB.Web" %>

<%@ OutputCache Duration="43200" VaryByParam="None" VaryByCustom="pageurl" Shared="true" %>
<%
    SessionData sessionData = new SessionData();
    if (sessionData != null && sessionData.trading != null)
    {
        if (sessionData.trading.loginType != CWB.Common.Constant.LoginType.Member)
        {
            string bar = string.Empty;
            string username = sessionData.trading.userName;
            username = username.Substring(0, 1).ToUpper() + username.Substring(1, username.Length - 1).ToLower();
            string dtsysdate = (ViewData["_cul"].ToString() == "en-gb") ? System.DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") : System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
            bar = string.Format("{0}<span id=\"lbClock\">{1}</span> &nbsp; {2} &nbsp; <a href=\"#\" class=\"ui-state-default ui-corner-all logout\"><span class=\"ui-icon ui-icon-power\"></span>{3}</a>", Resources.Text.Label_SystemTime + Resources.Text.Label_Colon, dtsysdate, username, Resources.Text.Logout);
            Response.Write(bar);
        }
        else
        {
            throw new Exception("You can't login into this website.");
        }
        
    }
%>